﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace YAMM
{
    public partial class Selection : Form
    {
        private static List<PlugIn.IPlugin> pluginList;
        public PlugIn.IPlugin SelectedItem { get; set; }

        public Selection()
        {
            InitializeComponent();
            pluginList = new List<YAMM.PlugIn.IPlugin>();
        }

        public void ClearItems()
        {
            pluginList = new List<YAMM.PlugIn.IPlugin>();
        }

        public void AddItem(YAMM.PlugIn.IPlugin item)
        {
            pluginList.Add(item);
        }

        private void Selection_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < pluginList.Count; i++)
            {
                listBox1.Items.Add(pluginList[i]);
            }
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            SelectedItem = pluginList[listBox1.SelectedIndex];
        }

        private void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
